Patch from David Knezevic starting implementation of complex IO.