creating and resizing second order variables