Adding CMAKE to project
Removed all warnings thrown during compilation.
Little more code refactoring