Fixed issue in weights.py

Needed to pass the weights array by copy rather than by reference--
didn't realize that the default was by reference.