Surprisingly close to getting it working