Update weighteffect.py

some bugs fixed