Created a generic error printing function and gave EVERYTHING proper error messages