Exercises working towards assignment 3