added headers, fixed csvwriter bug