Exercise 37 to 42

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