Added median function to stats.

Added median function to stats.