example how to read and write arrays from file