Code optimisation + stylistic changes

- A couple of code optimisation: fixed unnecessary count() and $i++.
- Code styles changes
- Version bump to 0.0.4