updated extract reads code