added a cleaning version of problem 1 on a whim