scripts part rewrited