template to animate sorting algorithms