add printf while loop for testing