slightly faster but less memory efficient medians