Added z optimization.

A tickbox can swap z values with x or y values.

Coding help from Bean.