add while loop