code re-fit