Making animation smooth