latest version of the weight algorithm