Fixed `if/else` and added comments