Final working script