Implemented IO as requested.