simplified and shrinked script