Implemented #5: added output, errors and warnings