changed averageSpeed to unsigned int