pseudo median
finished median