Added utility functions and headers