Adding search functions to the code