Added more generic calculation; Added a simple set relation
determination