revised AMI setup script