added foreach function, removed some too superficial functions that should be executed in the module, cant be too dependent on the framework