added some helper functions to use with scripts