typos and improved comments, whitespaces
raise exceptions with ()