Added recalculateAll function for validity checking