gamemode

Committed the actual gamemode, with some bugfixing done.