adding animation functionality