added CMakeLists, minor changes in main