refactor hw 3.5