commiting problem2 of assignment 1