added some functions to library -MM