Fixing the obj calculation for k=1 in the script