fixed bug where it would print regions to the bed file that were beyond the length of the chromosome