finished dog refactoring assignment