Refactored and captured all the errors(I think...)