changed header extension for cpp compiling. rearranged define.