Corrections to working code minus array

Works up to adding individual array values from file.