added some utility functions to mescal