Update IO.cpp

***Counter facility was added.
***fully functional writeError function
***writeHeader declaration