Changed if statement and fixed comment