added duration and timing functionality