Some random code I wrote, that my be of use someday :0.