Many changes to wam script