Updated python script to automatically format data