Solution to the assignment