Cleaned up exception handling, changed sections to directives, added
header