things work, need to further refactor