Ignore pyc files.
Minor fixes and replaced loggin with debug variable and print statements.