implemented iterator for testing