working solution for problem 1

Boo yah for problem 1 at least