assignment2 part2 working