p50 -> mean
some merges with olis code