Added displacement calculation.