Made animation script more portable