takeWhileInclusive example from StackOverflow