added length
added r->getLength
added getLength()