close the bedfile at the end. also, the previous commit fixed a bug that would not print the end of the last chromosome