Calculate percentiles on update. Fix stuff