Implement double cycle using Programmatic.

Closes #311.