updated part 2 feature extraction