go back to useing int64_t as it's the same size as double anyway