refactored the pipes. added params functionality to BinThenReg