-optimise switch added