Created function savewav