added a loop to the statement