optimized code, but still wrong answer