Completed first iteration of code to make all tests pass.