var geologymodule = new geologymodule(); foreach (var rock in geologymodule.discoverhiddenrocks()) { if (!rock.isprecommittal) { rock.meetrequirement(); rock.reinitiatestudy(); } else { messagebox.show("no need to dismiss, every rock has its story!"); } }