Implemented the Zaxis tracking code