a set of useful functions