eliminated MACRO for do length by providing both const and non-const versions