automated this gist: https://gist.github.com/armno/4036851