Changed method GetDisplacement for test purpose.