made script more 'universal'