implemented part2: vertical markovization