added animation function, reverse animation