Added padding compensation to generator example
Optimizing fixed boundary conditions code