An efficient iterative solver for the modes in a dielectric waveguide