script for game logic
This commit sucks and is broken