try to fix speed calculation