library changes, code reorganization, console output integration