Corrected offset maths (it was wrong)