Added some comments explaining the algorithm
Reformated a little
Added third exam-task