i have optimized code