basics working. needs a refactor.