Implementation of local search method