Corrected strange behaviour due to different units for x and y.