calculate safe and brake for probablity
calculate safe and brake for p