Optimization

optimization code