Used distance in speed calculation to make uniform among multiple devices.