Adding example solution #2 for question 1