Finished determine read length and read count subroutines