What I recall from discussion is that the pop() function not always behaves as expected.
The semantics of pop() are: return-and-remove-top-most-element().
By defition a pop() function does not do any search, it uses a stack approach with a LIFO policy.

So I suggest simply renaming this function or alter it's behavior.