add VarSet for arbitrary setting of variables
add comment explaining the order in which variables are set