Program works until outputfile, here it gives lists,not columns