added tests and main