Initial function for spawning waves.