Remove trailing spase and add spaces where needed to be compliant to the pep8
Remove some unused variables and fix some wrong identation
Pep8 and remove unused variables
Pep8 and remove unused variables, there are still some undefined variables present in the code
reduce the lenght of the code lines
Pep8 and remove unused libraries