inproves the animations code