switched from mean to median