new test for equation patterns/loops
fixed bug related with reassigning temporary variables used withing a loop that were defined outside