Optimizations submission#2

I updated the code to reflect the requested changes!