fully working script