Working CPS expansion with tests