Improve problem 1