primitive reverse mode implemented