~~ tail is probably O(n), so use iterator instead