improved rapidinv input generation