Simplified the script