Finished programming for assignment 2