Converted https://github.com/timvideos/planet/commit/9940deaa4f86fd97f693f79ad523a0a2309591d6