Added lazy self-optimization - broken