rewrite third stage in algo
1 stage modify and 6 stage create