prettified error output
removed wrong comments
added semantics