start adding phase change, still buggy