Fix syntax of ifelse statement
Revise comments