Exercises 8,9 and 10

Signed-off-by: Salil Kanitkar <slashforu@gmail.com>