change the alg of calc for events