Added utility unctions and headers. This time for real...