Some new code. proper cmakes, memory optimization etc.