This is my solution for assignment 2