finish writing variable for discrete