Merged branch reverted, modified PEP8 compliant code for exta clarity