make it build
fix bunch of unsigned/signed warnings
use a little more auto
Hopefully didn't brean anything!