Add functions for Morton order calculation