Jethro_, pretty sure that's caused by the fact that %temp only increases in the while loop if one of the conditionals is met.