solution for assignment2