updated extract_bed