broken now, need to refactor everything due to poor design