a few useful (maybe) routines