basic lbp implementation