Moved and added for exercise 2.2 of assignment 1