Lots of refactoring and passed tests. Exercise 1 completed for dock().