finish simplifications on stage2.R