embed function speeded up
script 3 updated and published