now using a single formula for 64- and 32-bits