Adjusting the search function
Added 'b->table" as the head node of the list and replace p with r