takeWhile is very useful.