Adding method to retrieve ancestor at a given level