added resolution as param to loops