changed variable name to uploaded_file
added csv sniffer function to handle file format issues