Index shows gains amid struggle