reorganized headers and updated cmake