modified a bit to use uint32_t and uint64_t