Update main.js

Now calculating ave length for temp_tween correctly