public static bool isLoaned(string bookCheck) //Method to check Loaned status of books { bool alreadyLoaned = false; foreach (var book in bookRecords.ToList()) { if (bookCheck == book.Key[0]) { alreadyLoaned = LoanDetails.isLoaned(bookCheck); //Checks if book matches a book in the list of loaned books in the Loan Details Class switch (alreadyLoaned) { case true: bookRecords[book.Key] = true; //Set that the book is already loaned return(true); case false: bookRecords[book.Key] = false; //Set that the book is not currently loaned break; } } } return(false); }