added code for problem 51