Refactor hw5.rkt