Fixed issues with sub animations not playing back correctly when animated in main timeline
Cleaned up code