Better IO routines
Update codes