Added gitignore file
Changed else if with elif
Fixed csv header

Now csv header is added once, on top of file.