solution to assignment2