fork from https://gist.github.com/henrik/1967800 for easy access