Adding solutions for problems 8 to 10

Adding solutions for problems 8 to 10, creating matching tests.