Reverse list during iteration