added some IO functions