Now works within its class for n iterations