new function  and moving utils to utils.js
some corrections