code for fitting standard BKT at scale