no need to re-edit the read name
cleanup
removed debugging cerr
added check for file existence
env etc.
fixed overcounting bug
removed debugging printouts
cleanup and within lambda added for readability