implementing pipeline regs (not finished)