change point code