Added method selection for median calculations