Add main funtion routines
Modify #includes after renaming error file