solution for assignemnt2