working version before AMD
added amd module loading