adds tests, and get rid of exceptions