added loop changes