Need to fix I/O writing and reading