Added third and forth problem

Finished third and forth problems from the assignment.