Removed wasted memory.
Added itervalues to variables.