Reverting to the working takingWhile