refactored the sound script