vector find algorithm