Code optimized

Code optimized