Back to using https://gist.github.com/imathis/1027674.