assignment 1 - problem 4

add problem 4 solution and modify problem 2 solution