changes to animation code, credit Brian as a contributor