Fixed if statements and moved comments into conditionals