fixed things, exceptions, error checking