Auto-format to read more easily (personally) and forgot to mention comments were added to explain exceptions.