added error checking and other modules and classes