we should read the warnings. they are very usefull :)

* removed warnings
* removed shadow variables
* safer use of compare for certain compiler versions (optimization related)