Added write_wave_file, Changed comments and variable names