fix for negative elevations and last contact point