adding optimizations