added preprocessing to feature extraction code