Version 2 all tests pass; logic absracted into methods
refactor: eliminated white space