updated to run without armadillo, xlevels has error