added some utility functions