added function zGetIndexPrimWave()