Completed problem51