lbp calculation loop added