added miscellaneous functions file