(All credit to @Tingyi for actually solving it!)