Reads bam file in one go, instead of fetching each contig separately. Takes about 5 min now for 100 reads instead of 10m. Have to see how time increases with larger data set.