@rhattersley could you add a doc-string please ... more comments than code (I know) but it is a public function.