added calcSpeed()