Fixed problem with doing 32 bit a*b/c that was overflowing, to use 64-bit multiplication and __div64_32 division. long data type is 32-bit on raspberry pi.