adding functions to wave.java