add iterator design pattern.