added support for changing Nc (Nc = 1: TM, Nc = 2 TE, Nc = 3 vector)