add IO functionality