cal and generate correction