Improved Script

- Improved Logics of the Script