adjust datatypes for summation to work on 32bit