implemented phase 1 - have to work in code refactoring