cleaned up getFeatureMatrix