Comments and bug fix

- Commented code better
- Fixed if statement bug