First commit, WIP on CP decomposition