Dodgy as fuck, but it works.