Added logging statements
Code formatting