ChatGPT loses coherency around 600 lines of Javascript, so this is the most I could push it