search function worked!
think of the array deep copy now