hw2 part 1 working