Better logging and error handling. Updated README.