updated installation with cmake. fixed some broken includes and other bugs