Changing login method to use database after verifying that the program works otherwise.