Added getMedian functions for reslsuts plus documentation