fleshed out the while statement