wave class implementation