why are you storing length value here?