first implementation of core.js