Added searchForLeaves method