The code I'm using is available here.