tweeked animate function