fixed a few bugs
now tries to check for victory condition, not 100% yet