modified getFeatureMatrix