Fixed Bugs / Improved script