final code for homework assignment login