completed the assignment code