Update functions.js

some usefull func