LBL algorithm implementation