write process_reads(reads, current_range) function