Homework2 in the bag. The code was just a little modification