Added iterator for the tail and test for the iterator