Added switched and foreach (probably some other things as well)