Code for a search inside of an array