added iterator class
added iterator and fixd some syntax