basics working, need to refactor