Part 2 of assignment 1