Added logger. changed code style for PEP8