Working version with no optimization and no propagation