pep8 and remove temp array as suggested by Ralf(in the discussion)