Better logic for IPv6 generation