Made a new method for linearSearch