added new functions to sdefs.m