fixing syntax error in avg_speed