Implemented IO primitives.
Corrected example program.