Implementation of extract_data

by Yann