finished core.js