Updating select loop to calculate score correctly