apprx add while loop