totalSpeed global variable