added unit tests
more code rewrite
updated README
reduced exceptions number