Made the script more robust and fixed arg1 comparison not working