also include input ID in the warning message, per suggestion of @jcheng5
move assignments out, per suggestion of @hadley