Completing part 3 of assigment 1