finished Story 3, but need refactoring