custom speed calculation