AMD version

TODO: Need to fix jshint

[Fixes #29]