Converted https://github.com/timvideos/planet/commit/9c72105d07e86335f93dd6ab171f6bdce6f2084f