Use a temporary counter to make sure that we don't have a fencepost error. Total counter should be the same as the number of programs requested.