added span' to takeWhile