starting code optimizations