trying to get https://gist.github.com/skhatri/5662604 working