implementing drop while.