Set graph to animate only between 0 and 10.
Cleaned and optimized code.