updated algorithm to read 64 bit integers