controlling hazard
solution using method 1
remove hazard