Implemented problem 29