Update from lunaryorn/blog@e0d3faa6d95cb567d7356dec902575691051b5a5