added animateWithInit and refactored