Committed tasks from chapter 7

tasks 3,7 and 9. The tasks are pretty challenging and i don't know if
they are done correctly, please do comment on their correctness.