updated for amd and minified