added animation and dropping code