cleaning up wave.java