look ok? https://gist.github.com/timgraham/dc1cc1abe202d3830eab