read and write functions changed!! init and read function stable