library of useful routines