pep8

and removing unreachable code
add custom logger

and change one logging statement