construct_weights function

Construct internal and external weights