Made changes from addition of I/O functions