I rewrote it as two if statements to make it less dense.