cleaning the python code a little bit. removing unused variables