Fix speed calculation