solving the assignment