added json to median.py