more efficient version of the find method