lab4: add IO operations