a collection of useful functions