Converted https://github.com/timvideos/planet/commit/7c76f274135609c0dcccb8a724eba8d2b3413e88