added z_nth_opt