Improved script for AIO