update two scripts

more simple code