still some error calculateDisplacement