Added a few miscellaneous functions