Works with simple optimizations