reading in file and populating memory array