IMplemented takeWhile.