Added producer logic, and test script.

Required minimal changes to existing code.