completed function.js