z-axis re-implemented