Code for the search problem(s)