added tests and analytics