modify the LBP code