Problem 1, Final version