vectorized edited for sake of analyze_features