search array

completed true false function
search array

refactored compare function to read easier.