fixed typo in minSearch fn