debugging malfunctioning optimizations