10x faster median and tests