complete the feature extractor function