adds more tests and fixes bugs for event sampling