add generalized ndim support + joblib