wrote passing tests for ex 8 and ex 9