Just need to add modular arithmetic to part 2, modify tb.