added some useful routines