solution to assignment 6