updated code for lbp