increased version
fixed cem.weights function