Completed problem 35, closes #42