cleaned up the underscore code and various things like error checking, they are all in the same format now