layer interator also needed local copy in rpp function