Change algo for calculating shared