added the read length function