Changing wrapping function so it's UMD compatible.