Added some I/O functionality