added duration method to rest