Updated printing code, other io stuff