Optimizing Some Code.