use groovy for math computations