My solution for the assignment 2.