code loop changed