Second Commit

added the system for error checking. Its not completed.