modify measureLength