remove while statement