Tadhg Pearson any chance you could add some unit tests and create a PR so that we can comment the implementation and try to converge on this one?