added printArray function and infile/makefile