Cleaned up the code meet 79 character limit per line
Also removed print statements; implemented logging module