Function createStepArray