add if statement and comment