move code around, minor performance enhancement for main game loop, where already-expanded squares dont get expanded twice