Converted https://github.com/timvideos/planet/commit/fa7c297d8f1f8aee57bc09eb7028c36837f677a0