added search product algorithm