Modularized the code slightly better to accommodate other types of features. Also added commented code for different types of smoothing.