moved code to set global animation to CE position to separate function