Modified compute.py to return contribution values