Adding the feature extraction code