Added two utility functions