added tests and flags