Completed problem 36, closes #43