added while statement stuff