Adding example code for the 3rd exercise