Ensuring correct looping order via right fold