Miscellaneous handy functions