overhaul using uint64 representation