switched ranking to median