Added a few tmp variables to calculate stuff outside of the strings and delarations.