put calculation out of the loop

No match.