Calculates displacement of steps