added median to stats.py