first version of working extractor