better system for determining errors
#4 and returns error all the way down