Minor changes to the amaka script, and added the global  variable.