moved csa construction in bsearch fcn