function.js fully upgraded