Major changes. Went to using csvdictreader to make the code more readable and make the header order irrelevant.