Added support for piping and flags