Added median maintenance, two sum