Optimization

new optimization fixes