New function from bernard's org-mode config