added some utilitarian functions