added https://gist.github.com/adamloving/4401361