added median to stats.py
incorporate jacqueline