While implementation