now identical to the gist file at https://gist.github.com/auser/64f2380eb45088d73e39