Converted https://github.com/timvideos/planet/commit/0cfb6362df347b2c7872faf4228d0d3f3d40d715