Starting to tidy up from assignment 2