use stdin instead of abusing argument passing