solution complete, refactor needed