Added about half of the error catching that I want