library of useful functions in javascript