Smarter problem 1