completed IO4 logic;