cleaned code and updated cmake