Added If statement and Analog Write