changed mean to median