Add sample and iterator function