full reading/writing from files