add argument handling, pipe mode, and start on error handling