Cleaned up earth.js