finished game logic.  Still needs a bunch of tweaks, but i'll make those when I can actually test this code