Adding the last changes which are not working for the animation. Need to resolve the animation issue. Documentationed some of the code.