Added threed mode that uses Z indexing.