reformat code
use logical operator instead of “if” statement