CMakeLists updated
use auto, fix name shadowing
Removed useless namespaces