flip while statement