Forloop to while change

This changes two for-loops to for each's under the hood.  This gave me a 2 second speed up on the sample script, but the speedup seems negligible on larger BAM files.  Submitted anyways...