There wasn't really any single resource I read. Frustratingly, I find it quite difficult to read research papers (I'm told it's a skill acquired with practice, but it's something I've never gotten into). Most of the implementation is the product of several rewrites and false-starts, along with the occasional hint I've read about here or there on the web.