Code for base IO.