Adding solutions and tests for homework 4