Changed animation algorithm