a few miscellaneous functions I've found useful