[setup] finished correcting unrolled code, began rewriting from scratch in setup2.py