takewhile done, improved performance in unfold