using while Loop