A solution to tutorial 1