Calculating Median Formula