solved problem 51