added tests and events model