two failing tests, distance method fixed
slight refactoring