first working version with txt file read/write