Used err functions to report errors
Rearranged includes
Added description of program