Added feature extraction code