Solution to assignment 1