chagned discharge to check for waveNumber before pushing. Updating waveNumber in startGlobalRelabeling function