Removed unneeded import and fixed wrong white spaces.
Removed non-required import
Changed argument name from format to simulator as format is a reserved keyword.
Removed non-needed import statement and avoided use of dummy variable.
Bug fix.

Corrected use of variable that was not defined. Avoided use of variable name exit which is a reserved keyword. Avoided the use of temporary variables that are not needed.
Removed double definition of function block. Avoided use of temporary variables.
Updated CHANGES.txt file.
Removed non-needed import statement.