Added solutions for problems 3,4,5,6

TODO: finish problem 2