This is an updated gist.