implement insertion and deletion animation