parsing input file and building arrays to insert into functions