Quick bodge to allow this to work as an external library