improved animation using matplotlib.animation module