updated with a working AMD example