completed problem 3

that one took longer than i had anticipated