More changes to DIO, still not quite working yet