Clean If statement and add a few comments.