slighly cleaner
was still ignoring base case
reverting the reverted change from looking in the document to looking in the frame
reverting the reverted change from looking in the document to looking in the frame