assignment 3: solution