all exercises done. time to refactor and add unit tests