Added error and warn logging with line numbers. Also added comments to each output block with file and line number