Added mechanism for weightSum