New animation code (MUST REFACTOR.)