Cleaned up weights.py