Added two new functions to assorted_functions.m