A few coding style fixes.

* Added license to the header file.
* Let the iteration counter be unsigned.
* Rename x to targetValue.