moved LB and RB code