WIP: generalize categorical to N-dimensions