Started implementing n-dimensional UID function