working 4th tutorial with Z buffering implemented