updated to allow piping