renamed setinv input arg to inv