Copying over work from hw2, to add to it