This should be a gist, but was easier to have it as a repo