How to calculate 50th percentile