Added iterators and did some cleaning.