Updated the linear combination portion by adding dynamic weights.