Simplified if statements, added comments to make static squares clearer.