Adding prepFeatures function