added animation function for 2d sim