Refactored itterator code, iterations now defined by rules itself