fully working basic i/o