adds a function to product the id array