private static void DeleteWord(string word)
        {
            if (!areYouSure())
            {
                return;
            }

            var wordToRemove = dbContext.Words.FirstOrDefault(x => x.Name == word);

            if (wordToRemove == null)
            {
                Console.WriteLine("The word is not contained in the list!", Color.Red);
            }
            else
            {
                dbContext.Entry(wordToRemove).State = System.Data.Entity.EntityState.Deleted;
                dbContext.SaveChanges();
                Console.SetCursorPosition(0, 1);
                Console.WriteLine("Success!", Color.Lime);

                //update lists
                WordsList = WordsList.Where(x => x != word).ToList();
                filtered  = filtered.Where(x => x != word).ToList();
            }

            Thread.Sleep(2000);
        }
        private static void ListWords(string substring)
        {
            if (substring == String.Empty)
            {
                return;
            }

            selectedWordId = 0;
            filtered       = WordsList.Where(x => x.ToLower().StartsWith(substring.ToLower())).ToList();

            int currentPage = 1;

            //Three lines go to user info output (directions, etc)
            var allowedLines = Constants.ConsoleDictionaryHeigth - 8;

            int pages = filtered.Count / allowedLines;

            if (filtered.Count % Constants.ConsoleDictionaryHeigth != 0)
            {
                pages++;
            }

            //draw pages loop
            while (true)
            {
                Console.Clear();
                PrintAlphabet("");
                PrintSearched(substring);

                var linesOnCurrentPage = Math.Min(allowedLines, filtered.Count - (currentPage - 1) * allowedLines);

                //printing current page
                var startingIndex = (currentPage - 1) * allowedLines;
                for (int i = startingIndex; i < startingIndex + linesOnCurrentPage; i++)
                {
                    if (i != selectedWordId)
                    {
                        Console.WriteLine($"{i + 1}. {filtered[i]}", Color.LightPink);
                    }
                    else
                    {
                        Console.WriteLine($">> {i + 1}. {filtered[i]}<<", Color.LimeGreen);
                    }
                }

                //print navigation info
                Console.WriteLine("Right/Left arrow to navigate", Color.Yellow);

                if (linesOnCurrentPage == 0 && currentPage == 1)
                {
                    Console.WriteLine($"Page 0|{pages}", Color.Yellow);
                }
                else
                {
                    Console.WriteLine($"Page {currentPage}|{pages}", Color.Yellow);
                }

                var key = Console.ReadKey();

                //changing pages
                var exit = false;
                switch (key.Key)
                {
                case ConsoleKey.Tab:
                case ConsoleKey.Backspace:
                    exit = true;
                    break;

                case ConsoleKey.LeftArrow:
                    if (currentPage == 1)
                    {
                        currentPage = pages;
                    }
                    else
                    {
                        --currentPage;
                    }
                    selectedWordId = (currentPage - 1) * allowedLines;
                    break;

                case ConsoleKey.RightArrow:
                    if (currentPage == pages)
                    {
                        currentPage = 1;
                    }
                    else
                    {
                        ++currentPage;
                    }
                    selectedWordId = (currentPage - 1) * allowedLines;
                    break;

                case ConsoleKey.DownArrow:
                    selectedWordId++;
                    if (selectedWordId == filtered.Count)
                    {
                        currentPage    = 1;
                        selectedWordId = 0;
                        break;
                    }

                    if (selectedWordId % allowedLines == 0)
                    {
                        ++currentPage;
                    }
                    break;

                case ConsoleKey.UpArrow:
                    if (selectedWordId == 0)
                    {
                        selectedWordId = filtered.Count - 1;
                        currentPage    = pages;
                    }
                    else
                    {
                        selectedWordId--;
                        if ((selectedWordId + 1) % allowedLines == 0)
                        {
                            --currentPage;
                        }
                    }
                    break;

                case ConsoleKey.Enter:
                    DeleteWord(filtered[selectedWordId]);
                    break;

                default:
                    exit = true;
                    break;
                }

                LastKeyPressed = key;

                if (exit)
                {
                    break;
                }
            }
        }
        public static void ListWords(int dummy)
        {
            Console.Clear();
            Mode.Set(GameMode.Dictionary);

            LoadWords();

            selectedWordId = 0;
            filtered       = WordsList.Where(w => w.ToLower()[0] == startingChar.ToString().ToLower()[0]).OrderBy(w => w)
                             .ToList();

            int currentPage = 1;

            var allowedLines = Constants.ConsoleDictionaryHeigth - 3;
            int pages        = filtered.Count / allowedLines;

            if (filtered.Count % Constants.ConsoleDictionaryHeigth != 0)
            {
                pages++;
            }

            //Three lines go to user info output (directions, etc)


            while (true)
            {
                Console.Clear();
                var linesOnCurrentPage = Math.Min(allowedLines, filtered.Count - (currentPage - 1) * allowedLines);

                //printing current page
                var startingIndex = (currentPage - 1) * allowedLines;
                for (int i = startingIndex; i < startingIndex + linesOnCurrentPage; i++)
                {
                    if (i != selectedWordId)
                    {
                        Console.WriteLine($"{i + 1}. {filtered[i]}", Color.LightPink);
                    }
                    else
                    {
                        Console.WriteLine($">> {i + 1}. {filtered[i]}<<", Color.LimeGreen);
                    }
                }

                //print navigation info
                Console.WriteLine("Press Escape to go back, Right/Left arrow to navigate", Color.Yellow);
                Console.WriteLine($"Page {currentPage}|{pages}", Color.Yellow);

                var key = Console.ReadKey();

                //changing pages
                var exit = false;
                switch (key.Key)
                {
                case ConsoleKey.Escape:
                    exit = true;
                    break;

                case ConsoleKey.LeftArrow:
                    if (currentPage == 1)
                    {
                        currentPage = pages;
                    }
                    else
                    {
                        --currentPage;
                    }
                    selectedWordId = (currentPage - 1) * allowedLines;
                    break;

                case ConsoleKey.RightArrow:
                    if (currentPage == pages)
                    {
                        currentPage = 1;
                    }
                    else
                    {
                        ++currentPage;
                    }
                    selectedWordId = (currentPage - 1) * allowedLines;
                    break;

                case ConsoleKey.DownArrow:
                    selectedWordId++;
                    if (selectedWordId == filtered.Count)
                    {
                        currentPage    = 1;
                        selectedWordId = 0;
                        break;
                    }

                    if (selectedWordId % allowedLines == 0)
                    {
                        ++currentPage;
                    }
                    break;

                case ConsoleKey.UpArrow:
                    if (selectedWordId == 0)
                    {
                        selectedWordId = filtered.Count - 1;
                        currentPage    = pages;
                    }
                    else
                    {
                        selectedWordId--;
                        if ((selectedWordId + 1) % allowedLines == 0)
                        {
                            --currentPage;
                        }
                    }
                    break;

                case ConsoleKey.Enter:
                    DeleteWord(filtered[selectedWordId]);
                    break;

                default:
                    key = Console.ReadKey();
                    break;
                }

                if (exit)
                {
                    break;
                }
            }
        }
        public static void ListWords()
        {
            Console.Clear();
            Mode.Set(GameMode.Dictionary);

            LoadWords();
            var groupedWords = WordsList.Where(w => !string.IsNullOrWhiteSpace(w)).GroupBy(w => w.ToLower()[0])
                               .OrderBy(g => g.Key);

            var maxLineLenght     = Constants.ConsoleDictionaryWidth - 1;
            var linesPerPage      = Constants.ConsoleMenuHeigth - 2;
            var currentPageNumber = 0;
            var allText           = new StringBuilder();

            foreach (var group in groupedWords)
            {
                allText.AppendLine($"[{group.Key} - {group.ToList().Count} words]");
                var words = new Stack <string>(group.ToList());
                while (words.Count > 0)
                {
                    var currentLine = "";
                    while (words.Count > 0 && currentLine.Length + words.Peek().Length < maxLineLenght - 2)
                    {
                        currentLine = string.Concat(currentLine, words.Pop());
                        if (words.Count != 0)
                        {
                            currentLine = string.Concat(currentLine, ", ");
                        }
                    }
                    allText.AppendLine(currentLine);
                }
                allText.AppendLine();
            }

            var allLines = allText.ToString().Split('\n');

            while (true)
            {
                Console.Clear();
                var linesOnCurrentPage = Math.Min(currentPageNumber + linesPerPage, allLines.Length);

                for (int i = currentPageNumber; i < linesOnCurrentPage; i++)
                {
                    Console.WriteLine(allLines[i], Color.Pink);
                }
                Console.WriteLine("Press the up and down arrow to navigate or ESC to exit");
                var key = Console.ReadKey();

                var exit = false;
                switch (key.Key)
                {
                case ConsoleKey.Escape:
                    exit = true;
                    break;

                case ConsoleKey.UpArrow:
                    if (currentPageNumber > 0)
                    {
                        currentPageNumber -= linesPerPage / 2;
                    }
                    break;

                case ConsoleKey.DownArrow:
                    if (currentPageNumber < allLines.Length - linesPerPage)
                    {
                        currentPageNumber += linesPerPage / 2;
                    }
                    break;

                default:
                    break;
                }

                if (exit)
                {
                    break;
                }
            }

            Menu.Initialize();
        }