Modifying the test_weights.py script