updated deleteMax