Completed Part 3 of Hw2, using sessions to save state