SFW, found this in a pastebin so I have no idea if it's the whole thing or just an excerpt, found here: https://pastebin.com/P2GBqrTM