Can now write correctly. This is implamented as WriteFile() in io.c