breaking out into better code but still wip