Added duration mode support, closes #166