clean up the code; count errors(no fit) and warnings separately (Alexei)