error checking finalized, comments inserted