add conditions to flowMeans