updated script to calculate task specific gains