added distance and slope method