Changed the python script to get rid of all those if's