added support for foreach loops, arrays now 1-based :(