initial script moved from as3 part