added the main swith variable back in.