add method getLength() and getPosition().