Added win detection, and rejects invalid characters (because fuck changing the structure NOW)