add while snippet