add function to calculate while compiling