tidied up some code. All tests are passing