Array median utility