fix math: rounding function,etc...