Added a function to output an error to the display and crash.
Updated function and variable names