add brian's fcn