problem 1 to 4 done