Improved sin_wave