This is a very expensive way of computing this information... Can't we just store the set somewhere and recompute it as needed?