added some helper functions