Event driven now with minivents
Moved compare out of the test function