Solution 2 completed