Move cpp to h and fix it