Added getDuration method.