delete unused lines and fixed pep8 fomatting