better error messages, whitespace cleanup, imports cleanup