improved definition of xTabulate