This should be outside the loop since inType doesn't change.