writing up the extraction procedure