median swap seems to work
median sweeping seems to be done; but the performance is not great