problem 6
adding my answers to the source files