Basic Optimizations for serial codes