Modified setAnd and setPipe, added few test codes for it