Debugging co-ordinate offset miscalculation issue